package com.xiaozhi.dao;



import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.xiaozhi.entity.DeviceVideo;

public interface DeviceVideoMapper {
    @Insert({"INSERT INTO deviceVideo (deviceId,openId,listenVideoName,listenVideoUrl,talkVideoName,talkVideoUrl,descs,createTime,updateTime,convertListenVideo,convertTalkVideo)",
     "values (#{deviceId},#{openId},#{listenVideoName},#{listenVideoUrl}, #{talkVideoName},#{talkVideoUrl},#{descs},#{createTime},#{updateTime}),#{convertListenVideo},#{convertTalkVideo} "})
    //@Options(useGeneratedKeys = true, keyProperty = "id")
    int add(DeviceVideo pic);

    

    @Select("select * from deviceVideo where deviceId = #{DeviceId}")
    DeviceVideo selectVideoByDeviceId(String DeviceId);

    @Update({"update deviceVideo set openId=#{openId},listenVideoName=#{listenVideoName},listenVideoUrl=#{listenVideoUrl}",
            "talkVideoName=#{talkVideoName},talkVideoUrl=#{talkVideoUrl},convertListenVideo=#{convertListenVideo},convertTalkVideo=#{convertTalkVideo}",
            "where deviceId=#{deviceId}"} )
    int update(DeviceVideo video);
}
